package com.xzp.blog.entity.vo;

import com.xzp.blog.entity.Article;
import org.hibernate.validator.constraints.NotEmpty;

/**
 * 修改博客视图类----对文章修改
 */
public class BlogModifyView {

    @NotEmpty
    private Integer id;  //对应于文章id
    @NotEmpty
    private String title; //文章标题
    private String mdMaterial; //对应的markdown内容  用来编辑
    private String description; //介绍

    /**
     * 由后台数据库的文章类,新建立博客文章类,
     * @param article
     */
    public BlogModifyView(Article article) {
        this.id = article.getId();
        this.title = article.getTitle();
        this.mdMaterial = article.getMdMaterial();
        this.description = article.getIntroduction();
    }

    public BlogModifyView() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getMdMaterial() {
        return mdMaterial;
    }

    public void setMdMaterial(String mdMaterial) {
        this.mdMaterial = mdMaterial;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
